package cn.newgrand.oa.legal.service.impl;

import cn.newgrand.oa.legal.service.TestService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class TestServiceImpl implements TestService {
    @Override
    public BigDecimal disCountSales(Long id, Integer type) {
        BigDecimal formalSales = BigDecimal.valueOf(5000);//id对应的商品价格
        BigDecimal result = null;
        if(type.equals(1)){
            result = formalSales.multiply(BigDecimal.valueOf(0.9));
        }else{
            result = formalSales.subtract(BigDecimal.valueOf(100));
        }
        return result;
    }
}
